package com.snopy.designPattern.structure.decorator;

import com.snopy.designPattern.structure.decorator.impl.HorizonScrollBarDecorator;
import com.snopy.designPattern.structure.decorator.impl.SimpleWindow;
import com.snopy.designPattern.structure.decorator.impl.VerticalScrollBarDecorator;
import com.snopy.designPattern.structure.decorator.inter.Window;
import com.snopy.designPattern.structure.decorator.inter.WindowDecotator;
import lombok.extern.slf4j.Slf4j;

/**
 * @author snopy
 * @version 1.0.0
 * @classname DecoratorPatternDemo
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/03 11:07
 */
@Slf4j
public class DecoratorPatternDemo {
    public static void main(String[] args) {
        Window window = new SimpleWindow();
        window.draw();
        log.info("desc:{}",window.getDescription());
        WindowDecotator hd = new HorizonScrollBarDecorator(window);
        hd.draw();
        hd.getDescription();
        log.info("desc:{}",hd.getDescription());
        WindowDecotator vd = new VerticalScrollBarDecorator(hd);
        vd.draw();
        vd.getDescription();
        log.info("desc:{}",vd.getDescription());

    }
}
